package com.qfjy.util;

import com.qfjy.entity.po.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @Author 小白
 * @Date 2021-11-14 13:58
 */
@Repository
public class TuLingUtil {
    @Autowired
    Location location;
    @Autowired
     UserInfo userInfo;
    @Autowired
    SelfInfo selfInfo;
    @Autowired
    InputText inputText;
    @Autowired
    TuLing tuLing;
    @Autowired
    Perception perception;
    public  TuLing getTuLingAPI(UserMessage message){

        inputText.setText(message.getText());

        location.setCity(message.getCity());
        location.setProvince(message.getProvince());
        location.setStreet(message.getStreet());

        userInfo.setUserId(message.getId());
        userInfo.setApiKey(message.getKey());

        selfInfo.setLocation(location);

        perception.setSelfInfo(selfInfo);
        perception.setInputText(inputText);



        tuLing.setReqType(0);
        tuLing.setPerception(perception);
        tuLing.setUserInfo(userInfo);

        return tuLing;
    }
}
